import { useRouter } from 'vue-router'
import store from "../store";
export function isLogin<U>(): any {
    let userFrom = window.localStorage.getItem('user');
    let router = useRouter();
    if (!userFrom) {
        router.push({ name: "login" })
    } else {
        store.commit('SET_USER', JSON.parse(userFrom));
    }
}